<?php
namespace app\index\controller;

class home extends Base
{
    public $tableName = "Menu";
    public function index()
    {
        cookie("base_project_id","");
        $where=[];
        if($this->allow_project_ids!=999){
            $where["id"]=array("in",$this->allow_project_ids);
        }
        $this->page($where,"","Project");
        //项目类型
        $project_type = model("CodeMap")->get_value("project_type");
        $project_status = model("CodeMap")->get_value("project_status");
        $data["project_type"] = array_column($project_type, "m_name", "m_value");
        $data["project_status"] = array_column($project_status, "m_name", "m_value");
        //业主单位
        $data["yz_list"] = model("Company")->where(["c_type" => 6])->select()->toArray();
        //总包单位
        $data["zb_list"] = model("Company")->where(["c_type" => 1])->select()->toArray();

        $data["users"] = model("admin")->where(["role_id" => array("NEQ", 1)])->select()->toArray();

        $data["yz_list"] = array_column($data["yz_list"], "name", "id");
        //总包单位
        $data["zb_list"] = array_column($data["zb_list"], "name", "id");
        $data["users"] = array_column($data["users"], "nickname", "id");

        $this->assign($data);
        return view();

    }

    public function test()
    {
        
      

       
    }


}
